// import com.alibaba.druid.sql.ast.SQLObjectImpl;
// import com.alibaba.druid.sql.visitor.SQLASTVisitor;

// import java.util.ArrayList;
// import java.util.List;

#include "SQLAlterTableRenamePartition.h"
#include "../../visitor/SQLASTVisitor.h"
#include "../../../utils/listTran.h"
#include "SQLAssignItem.h"

SQLAlterTableRenamePartition::SQLAlterTableRenamePartition()
{
  partition = std::make_shared<std::list<SQLAssignItem_ptr>>();
  to = std::make_shared<std::list<SQLAssignItem_ptr>>();
}
SQLAssignItem_list_ptr SQLAlterTableRenamePartition::getPartition()
{
  return partition;
}

BOOL_ptr SQLAlterTableRenamePartition::isIfNotExists()
{
  return ifNotExists;
}

void SQLAlterTableRenamePartition::setIfNotExists(BOOL_ptr ifNotExists)
{
  this->ifNotExists = ifNotExists;
}

SQLAssignItem_list_ptr SQLAlterTableRenamePartition::getTo()
{
  return to;
}

// @Override
void SQLAlterTableRenamePartition::accept0(SQLASTVisitor_ptr visitor)
{
  if (visitor->visit(SharedObject(SQLAlterTableRenamePartition)))
  {
    SQLObject_list_ptr tmp1 = ListTran::tran_class<SQLAssignItem, SQLObject>(partition);
    acceptChild(visitor, tmp1);
    SQLObject_list_ptr tmp2 = ListTran::tran_class<SQLAssignItem, SQLObject>(to);
    acceptChild(visitor, tmp2);
  }
  visitor->endVisit(SharedObject(SQLAlterTableRenamePartition));
}
